<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>License</title>
    <style>
        *:disabled, *[disabled] {
            cursor: not-allowed;
        }
        a, button, summary {
            cursor: pointer;
        }
        a:any-link {
            color: blue;
        }
    </style>
</head>
<body>
    
    <h1 data-main-caption>License</h1>

    <p>
        <a href="#" onclick="expand(); return false">[Expand All]</a>
        <a href="#" onclick="collapse(); return false">[Collapse All]</a>
    </p>

    <main>
        <div class="item-container">
            <hr>
            <h3>These are projects in this solution.</h3>

            <div class="item">
                <details>
                    <summary>MyPN532 Web Client</summary>
                    <my-license-info href="https://www.gnu.org/licenses/gpl-3.0.html">
                        <div slot="license">GPL-3.0</div>
                        <div slot="content">
                            <iframe src="./credits/gpl-3.0-standalone.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>MyPN532 Native Client</summary>
                    <my-license-info href="https://www.gnu.org/licenses/gpl-3.0.html">
                        <div slot="license">GPL-3.0</div>
                        <div slot="content">
                            <iframe src="./credits/gpl-3.0-standalone.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
        </div>

        <div class="item-container">
            <hr>
            <h3>These are third-party libraries used in this solution.</h3>
            
            <div class="item">
                <details>
                    <summary>libnfc</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/nfc-tools/libnfc">https://github.com/nfc-tools/libnfc</a></div>
                    <my-license-info href="https://github.com/nfc-tools/libnfc?tab=LGPL-3.0-1-ov-file">
                        <div slot="license">LGPL-3.0 License</div>
                        <div slot="content">
                            <iframe src="./credits/lgpl-3.0-standalone.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>mfoc</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/nfc-tools/mfoc">https://github.com/nfc-tools/mfoc</a></div>
                    <my-license-info href="https://github.com/nfc-tools/mfoc?tab=GPL-2.0-1-ov-file">
                        <div slot="license">GPL-2.0 License</div>
                        <div slot="content">
                            <iframe src="./credits/gpl-2.0.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>

            <div class="item">
                <details>
                    <summary>drogon</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/drogonframework/drogon">https://github.com/drogonframework/drogon</a></div>
                    <my-license-info href="https://github.com/drogonframework/drogon/blob/master/LICENSE">
                        <div slot="license">MIT License</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_drogon.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>Mifare Classic Tool (std.keys & extended-std.keys)</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/ikarus23/MifareClassicTool">https://github.com/ikarus23/MifareClassicTool</a></div>
                    <my-license-info href="https://github.com/ikarus23/MifareClassicTool?tab=GPL-3.0-1-ov-file">
                        <div slot="license">GPL-3.0 License</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_mct.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>jsoncpp</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/open-source-parsers/jsoncpp">https://github.com/open-source-parsers/jsoncpp</a></div>
                    <my-license-info href="https://github.com/open-source-parsers/jsoncpp/blob/master/LICENSE">
                        <div slot="content">
                            <iframe src="./credits/LICENSE_jsoncpp.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>monaco-editor</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/microsoft/monaco-editor">https://github.com/microsoft/monaco-editor</a></div>
                    <my-license-info href="https://github.com/microsoft/monaco-editor/?tab=MIT-1-ov-file">
                        <div slot="license">MIT license</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_monoeditor.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>ndef-nfc</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/andijakl/ndef-nfc">https://github.com/andijakl/ndef-nfc</a></div>
                    <my-license-info href="https://github.com/andijakl/ndef-nfc?tab=LGPL-3.0-1-ov-file">
                        <div slot="license">LGPL-3.0 license</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_ndef-nfc.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>@TapTrack/NdefJS</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/TapTrack/NdefJS">https://github.com/TapTrack/NdefJS</a></div>
                    <my-license-info href="https://github.com/TapTrack/NdefJS?tab=License-1-ov-file">
                        <div slot="license">pache License<sup style="margin-left: 0.5em;">*[sic]</sup></div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_NdefJS.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>MifareOneTool</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/xcicode/MifareOneTool">https://github.com/xcicode/MifareOneTool</a></div>
                    <my-license-info href="https://github.com/xcicode/MifareOneTool?tab=GPL-3.0-1-ov-file">
                        <div slot="license">GPL-3.0 License</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_m1t.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>Vue.js</summary>
                    <div>Project location: <a target="_blank" href="https://vuejs.org">https://vuejs.org</a></div>
                    <my-license-info href="https://opensource.org/license/mit/">
                        <div slot="license">MIT License</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_mit.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>Element-Plus</summary>
                    <div>Project location: <a target="_blank" href="https://element-plus.org/">https://element-plus.org/</a></div>
                    <my-license-info href="https://github.com/element-plus/element-plus/blob/master/LICENSE">
                        <div slot="license">MIT License</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_elplus.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>OpenSSL</summary>
                    <div>Project location: <a target="_blank" href="https://openssl.org">https://openssl.org</a></div>
                    <my-license-info href="https://www.openssl.org/source/license.html">
                        <div slot="content">
                            <iframe src="./credits/LICENSE_openssl.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>es-module-shims</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/guybedford/es-module-shims">https://github.com/guybedford/es-module-shims</a></div>
                    <my-license-info href="https://github.com/guybedford/es-module-shims?tab=MIT-1-ov-file">
                        <div slot="license">MIT license</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_es-module-shims.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>7-zip</summary>
                    <div>Project location: <a target="_blank" href="https://7-zip.org">https://7-zip.org</a></div>
                    <my-license-info href="https://7-zip.org/license.txt">
                        <div slot="license">GNU LGPL</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_7z.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>Require.js</summary>
                    <div>Project location: <a target="_blank" href="https://requirejs.org/">https://requirejs.org/</a></div>
                    <my-license-info href="https://github.com/requirejs/requirejs/blob/master/LICENSE">
                        <div slot="license"></div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_requirejs.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>zlib</summary>
                    <div>Project location: <a target="_blank" href="https://github.com/madler/zlib">https://github.com/madler/zlib</a></div>
                    <my-license-info href="https://github.com/madler/zlib/blob/master/LICENSE">
                        <div slot="content">
                            <iframe src="./credits/LICENSE_zlib.txt"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>c-ares</summary>
                    <div>Project location: <a target="_blank" href="https://c-ares.org/">https://c-ares.org/</a></div>
                    <my-license-info href="https://c-ares.org/license.html">
                        <div slot="license">MIT license</div>
                        <div slot="content">
                            <iframe src="./credits/LICENSE_c-ares.html"></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div>
            
            <div class="item">
                <details>
                    <summary>brotil</summary>
                    
                </details>
            </div>
            
            <!--div class="item">
                <details>
                    <summary></summary>
                    <div>Project location: <a target="_blank" href=""></a></div>
                    <my-license-info href="">
                        <div slot="license"></div>
                        <div slot="content">
                            <iframe src=""></iframe>
                        </div>
                    </my-license-info>
                </details>
            </div-->

        </div>

    </main>

    <style>
        [data-main-caption] {
            display: none;
        }
        main .item {
            margin-bottom: 10px;
        }
        main .item-container {
            padding: 5px;
        }
        main .item-container h3 {
            margin-top: 0;
        }
    </style>

    <script data-main-script>
        async function expand() {
            document.querySelectorAll('details').forEach(el => el.open = true);
        }
        async function collapse() {
            document.querySelectorAll('details').forEach(el => el.open = false);
        }
        function getUrlValue(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substring(1).match(reg);
            if (r != null) {
                try {
                    return decodeURIComponent(r[2]);
                } catch (e) {
                    return null;
                }
            }
            return null;
        }
        if (getUrlValue('expand') === 'true') { expand() }
    </script>

    <div data-internal>
        <template id="my-license-info">
            <div class="title">
                <slot name="license">License</slot>
            </div>
        
            <div class="link">
                This product is licensed under the license.<br>
                You can find the license text <a href="javascript:" id="link" target="_blank">here</a>.
            </div>
        
            <div class="content">
                <slot name="content"></slot>
            </div>
        
            <style>
                .title {
                    font-weight: bold;
                }
        
                a#link {
                    color: blue;
                    text-decoration: none;
                }
            </style>
        </template>
        <style>
            my-license-info {
                display: block;
        
                border: 2px solid var(--bordercolor);
                background: var(--background);
                border-radius: 10px;
        
                margin: 5px 0;
                padding: 10px;
        
                --bordercolor: #80deea;
                --background: #e0f7fa;
            }
        
            my-license-info [slot=content] iframe {
                border: 1px solid gray;
                border-radius: 10px;
                box-sizing: border-box;
                width: 100%;
                min-height: 50vh;
            }
        </style>
        <script data-custom-elements>
            (function () {
                const MyLicenseInfo = document.getElementById('my-license-info');
                customElements.define('my-license-info', class HTMLLicenseInfoElement extends HTMLElement {
                    #shadow = null;

                    constructor() {
                        super();

                        const shadow = this.attachShadow({ mode: 'closed' });
                        this.#shadow = shadow;
                        shadow.append(MyLicenseInfo.content.cloneNode(true));
                    }

                    update() {
                        this.#shadow.querySelector('#link').href = this.getAttribute('href');
                    }

                    static get observedAttributes() { return ['href']; }

                    attributeChangedCallback(name, oldValue, newValue) {
                        this.update.call(this);
                    }

                })
            }())
        </script>

    </div>

</body>
</html>